home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 74
/
Volume 74 My Disc - Damaged.iso
/
Games
/
shusher.swf
/
scripts
/
frame_40
/
DoAction.as
Wrap
Text File
|
2008-08-08
|
3KB
|
107 lines
setupTheatre();
noisyPeople = new Array();
noiseCounter = 0;
if(!lightsOn)
{
attachMovie("flashlight","Flashlight",9000);
if(highBeam)
{
Flashlight.gotoAndStop(2);
}
}
satisfaction = 100;
Interface.SatisMeter.gotoAndStop(100);
minutesLeft = 59;
secondsLeft = 59;
Game.Player.moveSpeed = playerMoveSpeed;
Game.Player.moveDir = null;
Game.Player._x = playerStartX;
Game.Player._y = playerStartY;
Game.Player.gotoAndStop("down");
playerBusy = false;
Flashlight._x = playerStartX;
Flashlight._y = playerStartY;
var musicSelection = randInt(1,6);
if(musicSelection <= 2)
{
SFX.gotoAndPlay("StartMovie1");
}
else if(musicSelection >= 3 && musicSelection <= 4)
{
SFX.gotoAndPlay("StartMovie2");
}
else if(musicSelection >= 5 && musicSelection <= 6)
{
SFX.gotoAndPlay("StartMovie3");
}
Game.onEnterFrame = function()
{
if(_root.gameInPlay)
{
_root.noiseCounter = _root.noiseCounter + 1;
if(_root.noiseCounter % _root.noiseFrequency == 0)
{
var _loc2_ = 1;
while(_loc2_ <= _root.noisesAtOnce)
{
if(_root.noisyPeople.length < _root.filledSeats)
{
unleashNoise();
}
_loc2_ = _loc2_ + 1;
}
}
_root.setTimerDigits(_root.minutesLeft,_root.secondsLeft,_root.Interface.GameTimer);
_root.satisfaction -= _root.noisyPeople.length * _root.satisDecrement;
if(_root.satisfaction <= 0)
{
_root.gotoAndPlay("GameOver");
}
var _loc3_ = _root.satisfaction - _root.Interface.SatisMeter._currentframe;
_root.Interface.SatisMeter.gotoAndStop(_root.Interface.SatisMeter._currentframe + Math.round(_loc3_ / 1.5));
}
};
Game.Player.onEnterFrame = function()
{
if(_root.gameInPlay)
{
this.currentRow = Math.ceil(this._y / tileHeight);
this.currentColumn = Math.ceil(this._x / tileWidth);
this.swapDepths((this.currentRow - 1) * 100 + this.currentColumn);
if(!playerBusy)
{
if(Key.isDown(38))
{
moveAvatar(this,"up");
this.Clip.gotoAndStop("Walk");
}
else if(Key.isDown(40))
{
moveAvatar(this,"down");
this.Clip.gotoAndStop("Walk");
}
else if(Key.isDown(37))
{
moveAvatar(this,"left");
this.Clip.gotoAndStop("Walk");
}
else if(Key.isDown(39))
{
moveAvatar(this,"right");
this.Clip.gotoAndStop("Walk");
}
else
{
this.Clip.gotoAndStop("Stop");
}
if(Key.isDown(32))
{
shush();
}
}
}
};
timerCode = setInterval(decrementTimer,timerUnit);
gameInPlay = true;
stop();